package com.lifesting.java2as3.analysis;

import org.eclipse.jdt.core.IJavaElement;

public class MatchDescriptor {
	private IJavaElement element;
	private int startPosition;
	private int length;
	public MatchDescriptor(IJavaElement element, int startPosition, int length) {
		super();
		this.element = element;
		this.startPosition = startPosition;
		this.length = length;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((element == null) ? 0 : element.hashCode());
		result = prime * result + length;
		result = prime * result + startPosition;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MatchDescriptor other = (MatchDescriptor) obj;
		if (element == null) {
			if (other.element != null)
				return false;
		} else if (element != other.element)
			return false;
		if (length != other.length)
			return false;
		if (startPosition != other.startPosition)
			return false;
		return true;
	}
	public IJavaElement getElement() {
		return element;
	}
	public int getStartPosition() {
		return startPosition;
	}
	public int getLength() {
		return length;
	}
	
	
}
